package cn.jlonely.xyhx.app.controller;

import cn.jlonely.xyhx.app.service.AppNotificationService;
import cn.jlonely.xyhx.pojo.Notification;
import cn.jlonely.xyhx.utils.Result;
import groovy.util.logging.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/app")
public class AppNotificationController {
    @Autowired
    private AppNotificationService appNotificationService;

    /**
     * 获取所有通知
     * @return
     */
    @GetMapping("/getNotificationAll")
    public Result getNotificationAll() {
        List<Notification> notificationList = appNotificationService.getNotificationAll();
        return Result.success(notificationList);
    }
}
